/*
PearReview - The peer review assistant.
Copyright (C) 2009  Dimitrij Pankratz, Anton Musichin
http://www.pearreview.com, info@pearreview.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

package com.pearreview.scribeplugin.csv;

import java.io.Serializable;

import com.pearreview.application.Messages;
import com.pearreview.util.review.Finding;

public class FindingDescriptionColumn implements FindingModelColumnRenderer, 
		Serializable {
	private static final long serialVersionUID = 7974389281923529489L;
	public static final String FIELD_NAME = Messages.getString(
			"PearReview.Scribe.findings.description");
	private String name = FIELD_NAME;
	@Override
	public String getColumnName() {
		return name + " [" + FIELD_NAME + "]";
	}
	@Override
	public String getValue(Finding finding) {
		return finding.getDescription();
	}
	@Override
	public Class<?> getValueClass() {
		return String.class;
	}
	@Override
	public boolean isEditable() {
		return false;
	}
	@Override
	public void setName(String newName) {
		name = newName;
	}
	@Override
	public String getName() {
		return name;
	}
	@Override
	public void setNewValue(Finding finding, Object newValue) { }
	@Override
	public String getStringValue(Finding finding) {
		return getValue(finding);
	}
}